package com.maysev.myjob_backend.utils;

import java.util.Arrays;

/**
 * @author 五七
 * @create 2023-04-07 9:58
 * @description:
 */
public class StringArrayUtils {
    /**
     * 数组格式字符串转 String 数组
     *
     * @param source
     * @return
     */
    public static String[] toStringArray(String source) {
        return source.substring(1,source.length()-1).split(",");
    }
    /**
     * 数组格式字符串转 long 数组
     *
     * @param source
     * @return
     */
    public static long[] toLongArray(String source) {
        return Arrays.stream(toStringArray(source)).mapToLong(Long::parseLong).toArray();
    }


}
